<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>Listado</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

		{% load staticfiles %} <link rel="stylesheet" href="{% static "css/spacelab.css" %}">
		{% load staticfiles %} <link rel="stylesheet" href="{% static "css/responsive.css" %}">
		{% load staticfiles %} <link rel="stylesheet" href="{% static "css/misestilos.css" %}">
		{% load staticfiles %} <link rel="stylesheet" href="{% static "css/datepicker.css" %}">
		
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/menu_jquery.css" %}">
	</head>

	<body>

		{% include "topmenu.html" %} <!-- Top menu -->
		<div class="container">
			<div class="row-fluid">
				{% include "sidebar.html" %} <!-- Side bar -->
				<!-- Formulario de Buenas Practicas -->
				<div class="span9">
					<div class="page-header">
						<h1>Listado de Formularios de Buenas Prácticas</h1>
					</div>
					<div class="span9">
						{%if buenaspracticasFC or buenaspracticasTC or buenaspracticasCS %}
							<table border="5" ALIGN="CENTER" WIDTH="800px" CELLPADDING="8">
								<tr ALIGN="CENTER"><th WIDTH="85%" colspan="3">Formación continua</th>
								<th WIDTH="15%"><a class="btn btn-primary" onclick="toggle_visibility_name('fc')" id="fc">Mostrar</a></th></tr>
								{%if buenaspracticasFC %}	
									<tr ALIGN="CENTER" name="fc" style="display: none;"><th WIDTH="45%">Nombre de la Iniciativa</th>
									<th WIDTH="20%">Fecha de inicio</th>
									<th WIDTH="10%"></th>
									<th WIDTH="15%"></th></tr>
									{% for bp in buenaspracticasFC %}
										<tr ALIGN="CENTER" name="fc" style="display: none;"><td>{{bp.iniciativa | safe}}</td>
										<td>{{bp.fecha_desde | safe}}</td>
										<td><a class="btn btn-primary" href="/plataforma/buenaspracticas/editar/{{bp.id}}">Editar</a></td>
										<td><a class="btn btn-primary" onClick="javascript:eliminar('{{bp.id}}')">Eliminar</a></td></tr>
									{%endfor%}
								{% else%}
									<tr ALIGN="CENTER" name="fc" style="display: none;"><td WIDTH="50%" colspan="2">No exiten formularios cargados</td>
									<td WIDTH="50%" colspan="2"><a href="/plataforma/buenaspracticas/agregar">Click aqui para cargar un formulario</a></td></tr>
								{%endif%}
								<tr ALIGN="CENTER"><th WIDTH="85%" colspan="3">Transferencia de Conocimiento</th>
								<th WIDTH="15%"><a class="btn btn-primary" onclick="toggle_visibility_name('tc')" id="tc">Mostrar</a></th></tr>
								{%if buenaspracticasTC %}
									<tr ALIGN="CENTER" name="tc" style="display: none;"><th WIDTH="45%">Nombre de la Iniciativa</th>
									<th WIDTH="20%">Fecha de inicio</th>
									<th WIDTH="10%"></th>
									<th WIDTH="15%"></th></tr>
									{% for bp in buenaspracticasTC %}
										<tr ALIGN="CENTER" name="tc" style="display: none;"><td>{{bp.iniciativa | safe}}</td>
										<td>{{bp.fecha_desde | safe}}</td>
										<td><a class="btn btn-primary" href="/plataforma/buenaspracticas/editar/{{bp.id}}">Editar</a></td>
										<td><a class="btn btn-primary" onClick="javascript:eliminar('{{bp.id}}')">Eliminar</a></td></tr>
									{%endfor%}
								{% else%}
									<tr ALIGN="CENTER" name="tc" style="display: none;"><td WIDTH="50%" colspan="2">No exiten formularios cargados</td>
									<td WIDTH="50%" colspan="2"><a href="/plataforma/buenaspracticas/agregar">Click aqui para cargar un formulario</a></td></tr>
								{%endif%}
								<tr ALIGN="CENTER"><th WIDTH="85%" colspan="3">Compromiso Social</th>
								<th WIDTH="15%"><a class="btn btn-primary" onclick="toggle_visibility_name('cs')" id="cs">Mostrar</a></th></tr>
								{%if buenaspracticasCS %}
									<tr ALIGN="CENTER" name="cs" style="display: none;"><th WIDTH="45%">Nombre de la Iniciativa</th>
									<th WIDTH="20%">Fecha de inicio</th>
									<th WIDTH="10%"></th>
									<th WIDTH="15%"></th></tr>
									{% for bp in buenaspracticasCS %}
										<tr ALIGN="CENTER" name="cs" style="display: none;"><td>{{bp.iniciativa | safe}}</td>
										<td>{{bp.fecha_desde | safe}}</td>
										<td><a class="btn btn-primary" href="/plataforma/buenaspracticas/editar/{{bp.id}}">Editar</a></td>
										<td><a class="btn btn-primary" onClick="javascript:eliminar('{{bp.id}}')">Eliminar</a></td></tr>
									{%endfor%}
								{% else%}
									<tr ALIGN="CENTER" name="cs" style="display: none;"><td WIDTH="50%" colspan="2">No exiten formularios cargados</td>
									<td WIDTH="50%" colspan="2"><a href="/plataforma/buenaspracticas/agregar">Click aqui para cargar un formulario</a></td></tr>
								{%endif%}
							</table>
						{% else%}
							<h3>No exiten formularios cargados</h3>
							<a href="/plataforma/buenaspracticas/agregar">Click aqui para cargar un formulario</a>
						{%endif%}
					</div>
				</div><!-- Fin span9-->
			</div>
			<!-- Modal -->
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			        <h4 class="modal-title" id="myModalLabel">Confirmación</h4>
			      </div>
			      <div class="modal-body">
			        Esta seguro que desea eliminar este formulario?
			      </div>
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
			        <a class="btn btn-primary" id="popupEliminar">Eliminar</a>
			      </div>
			    </div><!-- /.modal-content -->
			  </div><!-- /.modal-dialog -->
			</div><!-- /.modal -->

			<!-- Fin row -->
			{% include "footer.html" %} <!-- Footer -->
		</div>
		<!-- /container -->
		<!-- JS files -->
		{% load staticfiles %}
		<script type="text/javascript" src="{% static "js/jquery-1.10.2.min.js" %}"></script>
		{% load staticfiles %}
		<script type="text/javascript" src="{% static "js/bootstrap.js" %}"></script>
		{% load staticfiles %}
		<script type="text/javascript" src="{% static "js/toggle.js" %}"></script>
                {% load staticfiles %} <script type="text/javascript" src="{% static "js/menu_jquery.js" %}"></script>
		<script> function eliminar(fid){ 
			$('#myModal').modal('show'); 
			$("#popupEliminar").attr("href", "/plataforma/buenaspracticas/listar/"+fid+""); } 
		</script>
		
		<!-- {% load staticfiles %} <script type="text/javascript" src="{% static "js/parsley.js" %}"></script> -->
	</body>
</html>
